<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/shop/shop/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>门店状态：<input type="text" name="state" value="${requestScope.dwzPageBean.countResultMap.state}" placeholder="输入门店状态" /></td>
				</tr>
			</table>
			<div class="subBar">
				 <ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
				<li><a class="add" href="${pageContext.request.contextPath}/shop/shop/toInsert" rel="insert" target="dialog" width="820" height="460" mask="true"><span>添加</span></a></li>
				<li><a class="delete" href="${pageContext.request.contextPath}/shop/shop/delete" rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录" mask="true"><span>批量删除</span></a></li>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="id" class="checkboxCtrl"></th>
				<th orderField="shop_num" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_num'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺号</th>
				<th orderField="shop_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺名称</th>
				<th orderField="contacts" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'contacts'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系人</th>
				<th orderField="mobile_phone" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'mobile_phone'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>手机号码</th>
				<th orderField="area_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'area_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>地址</th>
				<th orderField="shopfwtm" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shopfwtm'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>跟进时间</th>
				<th orderField="shop_state" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_state'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺状态</th>
				<th orderField="allow_add_product" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'allow_add_product'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>是否允许新增商品</th>
				<th>操作</th>
			</tr>
			<!-- shop_id, shop_num, shop_name, shop_logo, shop_cover, contacts, contact_number, 
			mobile_phone, operating_pwd, area_code, area_name, address, postal_code, add_time,
			shop_state, allow_add_product, belongs, operator, longitude, latitude, del, maid, state, sgtm,
			source, ftae, imid, rgid, opid, ctno, stle, layout, template, remk, trid, cple -->
		</thead>
		<tbody>

			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/shop/shop/toUpdate?id=${record.shopId}" title="编辑">

						<td><c:if test="${record.del!=3}">
								<input name="shopId" value="${record.shopId }" type="checkbox">
							</c:if>
						</td>
						<td>${record.shopNum}</td>                                                       
						<td>${record.shopName}</td>       
						<td>${record.contacts}</td>                                   
						<td>${record.mobilePhone}</td>                                        
						<td>${record.areaName}</td>                                        
						<td><fmt:formatDate value="${record.shopfwtm}" pattern="yyyy-MM-dd" /></td> 
						<td>${record.shopState==1?"启用":"停用"}</td>      
						<td>${record.allowAddProduct==1?"允许":"不允许"}</td>       
						<td>
							<shiro:hasPermission name="/shop/shop/toUpdate">
								<a title="编辑" target="dialog" width="820" height="460" mask="true" href="${pageContext.request.contextPath}/shop/shop/toUpdate?id=${record.shopId}" class="editBtn"><span>编辑</span></a>
							</shiro:hasPermission>
							<shiro:hasPermission name="/shop/shop/toUpdate">
								<c:if test="${record.del!=3}">
									<a title="确定要删除吗？" mask="true" target="ajaxTodo" href="${pageContext.request.contextPath}/shop/shop/delete?id=${record.shopId}" class="deleteBtn"><span>删除</span></a>
								</c:if>
							</shiro:hasPermission>
							<%-- <shiro:hasPermission name="/shop/shopFollow/check"> --%>
								<a title="跟进" target="dialog" width="820" height="460" rel="genjin" href="${pageContext.request.contextPath}/customer/shopFollow/check?id=${record.shopId}" class="editBtn" mask="true"><span>跟进</span></a>
							<%-- </shiro:hasPermission> --%>
						</td>
					</tr>
				</c:forEach>
			</c:if>

		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>